package com.cy.myrxjavademo

class ImgLoader {

    companion object{
        fun load(sync: Boolean,url: String, callback: Callback){
            if (sync){
                Thread.sleep(3000)
                callback.onSuccess()
            }else{
                Thread{
                    Thread.sleep(3000)
                    callback.onSuccess()
                }.start()
            }
        }
    }

    interface Callback{
        fun onSuccess()
        fun onFailed()
    }
}